﻿using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Runtime.Serialization;
using System.Text;
using System.Text.Json.Serialization;

namespace Demo.Test.JosnTest
{

    public class TShirt
    {
        public string? Name { get; set; }
        public ColorScheme ColorScheme { get; set; }
    }

    public class Circle
    {
        public double Radius { get; set; }


        /// <summary>
        /// json序列化后转化为枚举值
        /// </summary>
        [JsonConverter(typeof(StringEnumConverter))]
        public Color BgColor { get; set; }
    }


    public enum ColorScheme
    {
        [EnumMember(Value = "白/蓝")]
        WhiteBlue,

        [EnumMember(Value = "红/黑")]
        RedBlack,
    }
}
